import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            redirect: '/Login',
        },
        {
            path: '/about',
            name: 'about',
            component: () =>
                import ('./views/About.vue')
        },
        {
            path: '/Login',
            name: 'login',
            component: () =>
                import ('./views/Login.vue')
        },
        {
            path: '/home',
            name: 'home',
            component: () =>
                import ('./views/Home.vue'),
            children: [{
                    path: '/welcome',
                    name: 'welcome',
                    component: () =>
                        import ('./views/welcome.vue'),

                },
                {
                    path: '/users',
                    name: 'users',
                    component: () =>
                        import ('./views/users.vue')
                },

                {
                    path: '/rights',
                    name: 'rights',
                    component: () =>
                        import ('./views/power/rights.vue')
                },
                {
                    path: '/roles',
                    name: 'roles',
                    component: () =>
                        import ('./views/power/roles.vue')
                },
                {
                    path: '/categories',
                    name: 'Cate',
                    component: () =>
                        import ('./views/goods/Cate.vue')
                },
                {
                    path: '/params',
                    name: 'Params',
                    component: () =>
                        import ('./views/goods/Params.vue')
                },
                {
                    path: '/goods',
                    name: 'goods',
                    component: () =>
                        import ('./views/goods/List.vue')
                },
                {
                    path: '/goods/add',
                    name: 'goods',
                    component: () =>
                        import ('./views/goods/Add.vue')
                },
                {
                    path: '/orders',
                    name: 'orders',
                    component: () =>
                        import ('./views/order/Order.vue')
                },
                {
                    path: '/reports',
                    name: 'reports',
                    component: () =>
                        import ('./views/report/Report.vue')
                },
            ]
        },

    ]
})